//
//  ERProperty.h
//  metadata
//
//  Created by easy on 11-5-30.
//  Copyright 2011 zeasy@qq.com. All rights reserved.
//
 
#import "ERuntime.h" 


// ERContext 环境下的类 属性
@interface ERProperty : NSObject {
	objc_property_t source;
	ERClass *clazz;
	
	ERPropertyReadWrite readWrite;	//读写类型	readonly ‘R’
	ERPropertyAssignment assignment;	//set值类型	retain ‘&’ copy ‘C’
	ERPropertyAtomicity atomicity;	//原子性类型	nonatomic ‘N’
	ERMethod *setter;				//setter 方法	S
	ERMethod *getter;				//getter 方法	G	readonly 时为nil
	ERField *mappedField;
}

#pragma mark property
@property (nonatomic, readonly) ERClass*			clazz;			//所在类
@property (nonatomic, readonly) objc_property_t		source;			//源数据
@property (nonatomic, readonly) NSString*			name;			//属性的名称
@property (nonatomic, readonly) NSString*			attributes;		//属性的特性
@property (nonatomic, readonly) ERClassType*		classType;		//T类类型
@property (nonatomic, readonly) ERField*			mappedField;	//V(variable)使用其他属性名时，对应的field
@property (nonatomic, readonly) ERMethod*			setterMethod;	//setter 方法 readonly时为nil
@property (nonatomic, readonly) ERMethod*			getterMethod;	//getter 方法
#pragma mark init
-(id) initWithProperty:(objc_property_t) prop atERClass:(ERClass *) aClazz;
#pragma mark attributes 分析
-(void) analysisAttributes;				//分析特性  初始化时已调用，不需要再调用
-(BOOL) isReadOnly;						//只读
-(BOOL) isReadWrite;					//可读写
-(BOOL) isAssign;						//仅赋值
-(BOOL) isRetain;						//计数加一，拥有对象
-(BOOL) isCopy;							//复制对象
-(BOOL) isAtomic;						//原子性
-(BOOL) isNonatomic;					//非原子性
@end
